package service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import dao.OrdersDao;
import domain.Orders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrdersService {
    @Autowired
    private OrdersDao ordersDao;

    public PageInfo<Orders> findOrdersAll(int pageNum,int pageSize){
        PageHelper.startPage(pageNum, pageSize);
        List<Orders> all = ordersDao.findAll();
        PageInfo pageInfo = new PageInfo(all);
        return pageInfo;
    }

    public Orders findOrdersById(String id){
        return ordersDao.findById(id);
    }
}
